home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 25 / AACD 25.iso / AACD / Magazine / Online / QMail / man / cat5 / mbox.0 < prev    next >
Encoding:
Text File  |  1997-09-21  |  6.6 KB  |  199 lines

  1.  
  2.  
  3.  
  4. mbox(5)                                                   mbox(5)
  5.  
  6.  
  7. NNAAMMEE
  8.        mbox - file containing mail messages
  9.  
  10. IINNTTRROODDUUCCTTIIOONN
  11.        The  most  common  format  for storage of mail messages is
  12.        _m_b_o_x format.  An _m_b_o_x is a single file containing zero  or
  13.        more mail messages.
  14.  
  15. MMEESSSSAAGGEE FFOORRMMAATT
  16.        A message encoded in _m_b_o_x format begins with a FFrroomm__ line,
  17.        continues with a series of non-FFrroomm__ lines, and ends  with
  18.        a  blank  line.   A  FFrroomm__ line means any line that begins
  19.        with the characters F, r, o, m, space:
  20.  
  21.             From god@heaven.af.mil Sat Jan  3 01:05:34 1996
  22.             Return-Path: <god@heaven.af.mil>
  23.             Delivered-To: djb@silverton.berkeley.edu
  24.             Date: 3 Jan 1996 01:05:34 -0000
  25.             From: God <god@heaven.af.mil>
  26.             To: djb@silverton.berkeley.edu (D. J. Bernstein)
  27.  
  28.             How's that mail system project coming along?
  29.  
  30.  
  31.        The final line is a completely blank line  (no  spaces  or
  32.        tabs).   Notice that blank lines may also appear elsewhere
  33.        in the message.
  34.  
  35.        The FFrroomm__ line always looks like FFrroomm _e_n_v_s_e_n_d_e_r _d_a_t_e _m_o_r_e_-
  36.        _i_n_f_o.   _e_n_v_s_e_n_d_e_r  is one word, without spaces or tabs; it
  37.        is usually the envelope sender of the  message.   _d_a_t_e  is
  38.        the  delivery  date  of  the  message.  It always contains
  39.        exactly 24 characters  in  aassccttiimmee  format.   _m_o_r_e_i_n_f_o  is
  40.        optional; it may contain arbitrary information.
  41.  
  42.        Between  the FFrroomm__ line and the blank line is a message in
  43.        RFC 822 format, as described in  qqmmaaiill--hheeaaddeerr((55)),  subject
  44.        to >>FFrroomm qquuoottiinngg as described below.
  45.  
  46. HHOOWW AA MMEESSSSAAGGEE IISS DDEELLIIVVEERREEDD
  47.        Here is how a program appends a message to an _m_b_o_x file.
  48.  
  49.        It first creates a FFrroomm__ line given the message's envelope
  50.        sender and the current date.  If the  envelope  sender  is
  51.        empty  (i.e.,  if  this  is a bounce message), the program
  52.        uses MMAAIILLEERR--DDAAEEMMOONN instead.  If the envelope  sender  con-
  53.        tains spaces, tabs, or newlines, the program replaces them
  54.        with hyphens.
  55.  
  56.        The program then copies the message, applying >>FFrroomm  qquuoott--
  57.        iinngg  to each line.  >>FFrroomm qquuoottiinngg ensures that the result-
  58.        ing lines are not FFrroomm__ lines: the program prepends a >> to
  59.        any  FFrroomm__ line, >>FFrroomm__ line, >>>>FFrroomm__ line, >>>>>>FFrroomm__ line,
  60.        etc.
  61.  
  62.  
  63.  
  64.                                                                 1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. mbox(5)                                                   mbox(5)
  71.  
  72.  
  73.        Finally the program appends a blank line to  the  message.
  74.        If  the  last  line  of the message was a partial line, it
  75.        writes two newlines; otherwise it writes one.
  76.  
  77. HHOOWW AA MMEESSSSAAGGEE IISS RREEAADD
  78.        A reader scans through an  _m_b_o_x  file  looking  for  FFrroomm__
  79.        lines.   Any  FFrroomm__ line marks the beginning of a message.
  80.        The reader should not attempt to  take  advantage  of  the
  81.        fact  that  every  FFrroomm__  line  (past the beginning of the
  82.        file) is preceded by a blank line.
  83.  
  84.        Once the reader finds a message, it extracts  a  (possibly
  85.        corrupted)  envelope  sender  and delivery date out of the
  86.        FFrroomm__ line.  It then reads until the next  FFrroomm__  line  or
  87.        end  of  file,  whichever  comes first.  It strips off the
  88.        final blank line and deletes the quoting of  >>FFrroomm__  lines
  89.        and  >>>>FFrroomm__  lines  and  so on.  The result is an RFC 822
  90.        message.
  91.  
  92. CCOOMMMMOONN MMBBOOXX VVAARRIIAANNTTSS
  93.        There are many  variants  of  _m_b_o_x  format.   The  variant
  94.        described  above  is  _m_b_o_x_r_d  format, popularized by Rahul
  95.        Dhesi in June 1995.
  96.  
  97.        The original _m_b_o_x_o format quotes  only  FFrroomm__  lines,  not
  98.        >>FFrroomm__  lines.   As  a  result  it  is  impossible to tell
  99.        whether
  100.  
  101.             From: djb@silverton.berkeley.edu (D. J. Bernstein)
  102.             To: god@heaven.af.mil
  103.  
  104.             >From now through August I'll be doing beta  testing.
  105.             Thanks for your interest.
  106.  
  107.        was quoted in the original message.  An _m_b_o_x_r_d reader will
  108.        always strip off the quoting.
  109.  
  110.        _m_b_o_x_c_l format is like _m_b_o_x_o format, but  includes  a  Con-
  111.        tent-Length field with the number of bytes in the message.
  112.        _m_b_o_x_c_l_2 format is like _m_b_o_x_c_l but has  no  >>FFrroomm  quoting.
  113.        These formats are used by SVR4 mailers.  _m_b_o_x_c_l_2 cannot be
  114.        read safely by _m_b_o_x_r_d readers.
  115.  
  116. UUNNSSPPEECCIIFFIIEEDD DDEETTAAIILLSS
  117.        There are many locking mechanisms for _m_b_o_x files.   qqmmaaiill--
  118.        llooccaall always uses fflloocckk on systems that have it, otherwise
  119.        lloocckkff.
  120.  
  121.        The delivery date in a FFrroomm__ line does not specify a  time
  122.        zone.  qqmmaaiill--llooccaall always creates the delivery date in GMT
  123.        so that _m_b_o_x files can be safely transported from one time
  124.        zone to another.
  125.  
  126.        If  the  mtime on a nonempty _m_b_o_x file is greater than the
  127.  
  128.  
  129.  
  130.                                                                 2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. mbox(5)                                                   mbox(5)
  137.  
  138.  
  139.        atime, the file has new mail.  If  the  mtime  is  smaller
  140.        than  the atime, the new mail has been read.  If the atime
  141.        equals the mtime, there is no way to tell whether the file
  142.        has  new  mail,  since  qqmmaaiill--llooccaall takes much less than a
  143.        second to run.  One solution is for a mail reader to arti-
  144.        ficially set the atime to the mtime plus 1.  Then the file
  145.        has new mail if and only if the  atime  is  less  than  or
  146.        equal to the mtime.
  147.  
  148.        Some  mail  readers place SSttaattuuss fields in each message to
  149.        indicate which messages have been read.
  150.  
  151. SSEEEE AALLSSOO
  152.        maildir(5), qmail-header(5), qmail-local(8)
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.                                                                 3
  197.  
  198.  
  199.